class meteorite {
  constructor(board) {
    this.board = board
    this.id = board.meteoriteId
    this.ctx = board.ctx
    this.x = 950
    this.randomY = (Math.random() * 525) + 50 
    this.positionX = 0
    this.width = 100
    this.height = 100
    this.img = images['meteorite']
    this.speed = 0
    this.rotate = 0
    this.hp = 1
    this.draw()
  }
  draw() {
    this.rotate++
    this.speed += 3
    this.positionX = this.x + 50 - this.speed
    this.ctx.save()
    this.ctx.translate(this.positionX, this.randomY);
    this.ctx.rotate(this.rotate * Math.PI / 180)
    this.ctx.drawImage(this.img, -50, -50, this.width, this.height)
    this.ctx.restore()
  }
}
export { meteorite }